Release 10.1A: OpenEdge Development:
Progress 4GL Reference
CREATE automation object statement
(Windows only)Creates (instantiates) an ActiveX Automation object based on a specified Automation Server connection.
Syntax
expression1A character-string expression that evaluates to 1) a unique name of a valid Automation object stored in the system registry or 2) the null string ("").
COM-hdl-varA COM-HANDLE variable that receives the COM handle to the instantiated Automation object.
[CONNECT [ TOexpression2] ]Specifies the connection option, together with
expression1. The behavior of each connection option depends on the execution status of the Automation Server.Table 18 illustrates this behavior.
NO-ERRORSuppresses error messages for the instantiation of an Automation object. You can then test for the ERROR condition to verify that the Automation object is instantiated.
ExampleThe following procedure demonstrates several Automation object instantiations using the four basic connection options. It tries all of the options with the Microsoft® Excel Automation Server. Note that not all Automation Servers support all options. For example in Office 95, there is no Automation object for PowerPoint presentations. Thus, the file connection option (Option 3 in Table 18) does not work.
Notes
- You must ensure that any third-party Automation objects you want to instantiate are installed and correctly listed in the registry. For information on what Automation objects you can instantiate, see the documentation for the third-party product. Generally, these are the same Automation objects instantiated by the Visual Basic CreateObject and GetObject functions. You might also be able to view these Automation objects using the OpenEdge COM Object Viewer tool. For more information, see OpenEdge Development: Programming Interfaces .
- The instantiation of an Automation object depends on the implementation of the Automation Server itself. Any Server registered for multiple use (REGCLS_MULTIPLE_USE flag) launches a single instance of the Server that handles multiple Automation object instantiation requests. Any Server registered single use (REGCLS_SINGLE_USE flag) launches a new instance of the Server for each instantiated Automation object.
- The four connection options in Table 18 compare to the following Visual Basic function calls:
- Once you create or connect to an Automation object, you can reference its properties and methods.
See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |